public class Main {
    public static void main(String[] args) {
/*        String str1 = new String("hello");
        String str2 = str1.replace('e','a');
        String str3 = str1.replace("he","HE");
        String str4 = str1.replaceAll("he","Ha");

        System.out.println(str2);
        System.out.println(str3);
        System.out.println(str4);*/
        String str1 = new String("aabbccaabbde");
        String str2 = str1.replaceAll("aa","ff");
        String str3 = str1.replaceFirst("aa","ff");

        System.out.println(str2);
        System.out.println(str3);
    }
}
